﻿using EYCmsAdmin.Domain.Models;
using FluentNHibernate.Mapping;

namespace EYCmsAdmin.NHibernate.Mappings
{
    public class StudyGroupMap : ClassMap<StudyGroup>
    {
        public StudyGroupMap()
        {
            Id(x => x.Id).Not.Nullable().GeneratedBy.Identity();
            Map(x => x.Name).Length(50).Not.Nullable();
            References(x => x.User,"UserId").Cascade.None().Not.Nullable();
            References(x => x.EducationInstitution, "EducationInstitutionId").Cascade.None().Not.Nullable();
            References(x => x.StudyGroupInformation, "StudyGroupInformationId").Cascade.None().Not.Nullable();
        } 
    }
}
